﻿<%@ Page Language="C#" MasterPageFile="~/Themes/ContentPage.master" %>

<script runat="server">
    
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        if (NewsId <= 0)
        {
            NewsInfo info = News.GetFirstNews(SiteContext.Current.CategoryId);
            if (info != null)
                Page.Response.Redirect(SiteUrls.Urls.AboutUs(info), true);
        }
    }

    private string GetBackgroundImageUrl()
    {
        var imageName = "bgs1.jpg";
        
        switch (SiteContext.Current.CategoryId)
        {
            case 3:
                imageName = "bgs3.jpg";
                break;
            case 4:
                imageName = "bgs4.jpg";
                break;
            case 5:
                imageName = "bgs5.jpg";
                break;
            case 6:
                imageName = "bgs6.jpg";
                break;
            default :
                break;
        }

        return Globals.GetSkinPath(string.Format("images/{0}",imageName));
    }
    
    protected int NewsId
    {
        get { return SiteContext.Current.Id; }
    }

    private int CateogryId
    {
        get { return SiteContext.Current.CategoryId; }
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="Server">

    <lswweb:NewsShow ID="aboutUsShow" IsRenderTag="false" runat="server">   
        <Skin>
            <asp:Literal ID="lbBody" runat="server"></asp:Literal>
        </Skin>
    </lswweb:NewsShow>
</asp:Content>
